package start.demo01.collection.hash;

import org.junit.Test;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class HashTest {
    public static void main(String[] args){
        HashSet set=new HashSet();
        set.toString();
        LinkedHashSet lhs=new LinkedHashSet();
        TreeSet ts=new TreeSet();
        ConcurrentHashMap map=new ConcurrentHashMap();
        HashMap hmmap=new HashMap();
        Hashtable ht=new Hashtable();
        String s=new String();
        TreeMap tm=new TreeMap();
        tm.put(0,null);
        int $21=120;
    }
    public final static synchronized void t1(){
        HashMap map=new HashMap();
        map.put('a',null);

        //返回一个子类实现，装饰者，不影响原数据
        map= (HashMap) Collections.synchronizedMap(map);//轉換成线程安全map
        Object o=new Object();
        Thread t=new Thread();

    }
    @Test
    public void t0(){
        Comparable k = (Comparable)0;
        System.out.println(k.compareTo(1));//基本类型可比较
    }
    @Test public void t3(){
        LinkedHashMap map=new LinkedHashMap();
        map.put("id","213");
        map.put("iew","xwd");
        map.put("dew","cxsdc");
        System.out.println(map.get("dew"));
    }
    @Test public void t4(){
        HashSet set=new HashSet();
        set.add(1);
    }
}
